/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package protocolHandler;

import java.util.HashMap;

/**
 *
 * @author Александр Емельянов (mr.lex91@gmail.com)
 */
abstract class ProtoHandler {
    private String type="";
    private HashMap<String, String> list= new HashMap<String, String>();

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void addHeader(String type, String val)
    {
        list.put(type, val);
    }

    public String getHeaderVal(String headerType)
    {
        return list.get(headerType);
    }

    public void setHeader(String type, String val)
    {
        list.remove(type);
        list.put(type, val);
    }

    public void clear()
    {
        type="";
        if (!list.isEmpty())list.clear();
    }
}
